<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Class template extents</title>
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../index.html" title="Chapter 1. Boost.Compute">
<link rel="up" href="../../boost_compute/reference.html#header.boost.compute.utility.extents_hpp" title="Header &lt;boost/compute/utility/extents.hpp&gt;">
<link rel="prev" href="dim.html" title="Function template dim">
<link rel="next" href="invoke.html" title="Function template invoke">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="dim.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_compute/reference.html#header.boost.compute.utility.extents_hpp"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="invoke.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.compute.extents"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Class template extents</span></h2>
<p>boost::compute::extents</p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../boost_compute/reference.html#header.boost.compute.utility.extents_hpp" title="Header &lt;boost/compute/utility/extents.hpp&gt;">boost/compute/utility/extents.hpp</a>&gt;

</span><span class="keyword">template</span><span class="special">&lt;</span><span class="identifier">size_t</span> N<span class="special">&gt;</span> 
<span class="keyword">class</span> <a class="link" href="extents.html" title="Class template extents">extents</a> <span class="special">{</span>
<span class="keyword">public</span><span class="special">:</span>
  <span class="comment">// types</span>
  <span class="keyword">typedef</span> <span class="identifier">size_t</span>                     <a name="boost.compute.extents.size_type"></a><span class="identifier">size_type</span><span class="special">;</span>     
  <span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">array</span><span class="special">&lt;</span> <span class="identifier">size_t</span><span class="special">,</span> <span class="identifier">N</span> <span class="special">&gt;</span>  <a name="boost.compute.extents.array_type"></a><span class="identifier">array_type</span><span class="special">;</span>    
  <span class="keyword">typedef</span> <span class="identifier">array_type</span><span class="special">::</span><span class="identifier">iterator</span>       <a name="boost.compute.extents.iterator"></a><span class="identifier">iterator</span><span class="special">;</span>      
  <span class="keyword">typedef</span> <span class="identifier">array_type</span><span class="special">::</span><span class="identifier">const_iterator</span> <a name="boost.compute.extents.const_iterator"></a><span class="identifier">const_iterator</span><span class="special">;</span>

  <span class="comment">// <a class="link" href="extents.html#boost.compute.extentsconstruct-copy-destruct">construct/copy/destruct</a></span>
  <a class="link" href="extents.html#idm45822164760336-bb"><span class="identifier">extents</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">explicit</span> <a class="link" href="extents.html#idm45822164758560-bb"><span class="identifier">extents</span></a><span class="special">(</span><span class="identifier">size_t</span><span class="special">)</span><span class="special">;</span>
  <a class="link" href="extents.html#idm45822164755392-bb"><span class="identifier">extents</span></a><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">initializer_list</span><span class="special">&lt;</span> <span class="identifier">size_t</span> <span class="special">&gt;</span><span class="special">)</span><span class="special">;</span>

  <span class="comment">// <a class="link" href="extents.html#idm45822164786496-bb">public member functions</a></span>
  <span class="identifier">size_type</span> <a class="link" href="extents.html#idm45822164785936-bb"><span class="identifier">size</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">size_type</span> <a class="link" href="extents.html#idm45822164784480-bb"><span class="identifier">linear</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">size_t</span> <span class="special">*</span> <a class="link" href="extents.html#idm45822164782848-bb"><span class="identifier">data</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">const</span> <span class="identifier">size_t</span> <span class="special">*</span> <a class="link" href="extents.html#idm45822164780752-bb"><span class="identifier">data</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">iterator</span> <a class="link" href="extents.html#idm45822164779088-bb"><span class="identifier">begin</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
  <span class="identifier">const_iterator</span> <a class="link" href="extents.html#idm45822164778240-bb"><span class="identifier">begin</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">const_iterator</span> <a class="link" href="extents.html#idm45822164777120-bb"><span class="identifier">cbegin</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">iterator</span> <a class="link" href="extents.html#idm45822164776000-bb"><span class="identifier">end</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
  <span class="identifier">const_iterator</span> <a class="link" href="extents.html#idm45822164775152-bb"><span class="identifier">end</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">const_iterator</span> <a class="link" href="extents.html#idm45822164774032-bb"><span class="identifier">cend</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">size_t</span> <span class="special">&amp;</span> <a class="link" href="extents.html#idm45822164772912-bb"><span class="keyword">operator</span><span class="special">[</span><span class="special">]</span></a><span class="special">(</span><span class="identifier">size_t</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">const</span> <span class="identifier">size_t</span> <span class="special">&amp;</span> <a class="link" href="extents.html#idm45822164770624-bb"><span class="keyword">operator</span><span class="special">[</span><span class="special">]</span></a><span class="special">(</span><span class="identifier">size_t</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="keyword">bool</span> <a class="link" href="extents.html#idm45822164768272-bb"><span class="keyword">operator</span><span class="special">==</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="extents.html" title="Class template extents">extents</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="keyword">bool</span> <a class="link" href="extents.html#idm45822164764384-bb"><span class="keyword">operator</span><span class="special">!=</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="extents.html" title="Class template extents">extents</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>

  <span class="comment">// public data members</span>
  <span class="keyword">static</span> <span class="keyword">const</span> <span class="identifier">size_type</span> <span class="identifier">static_size</span><span class="special">;</span>
<span class="special">}</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="idm46604969265248"></a><h2>Description</h2>
<p>The extents class contains an array of n-dimensional extents.</p>
<p><span class="bold"><strong>See Also:</strong></span></p>
<p>dim() </p>
<p>
</p>
<p>
</p>
<div class="refsect2">
<a name="idm46604969263232"></a><h3>
<a name="boost.compute.extentsconstruct-copy-destruct"></a><code class="computeroutput">extents</code> 
        public
       construct/copy/destruct</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><a name="idm45822164760336-bb"></a><span class="identifier">extents</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>
<p>Creates an extents object with each component set to zero.</p>
<p>For example: </p>
<pre class="programlisting"><span class="identifier">extents</span><span class="special">&lt;</span><span class="number">3</span><span class="special">&gt;</span> <span class="identifier">exts</span><span class="special">(</span><span class="special">)</span><span class="special">;</span> <span class="comment">// (0, 0, 0)</span>
</pre>
<p> </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">explicit</span> <a name="idm45822164758560-bb"></a><span class="identifier">extents</span><span class="special">(</span><span class="identifier">size_t</span> value<span class="special">)</span><span class="special">;</span></pre>
<p>Creates an extents object with each component set to <code class="computeroutput">value</code>.</p>
<p>For example: </p>
<pre class="programlisting"><span class="identifier">extents</span><span class="special">&lt;</span><span class="number">3</span><span class="special">&gt;</span> <span class="identifier">exts</span><span class="special">(</span><span class="number">1</span><span class="special">)</span><span class="special">;</span> <span class="comment">// (1, 1, 1)</span>
</pre>
<p> </p>
</li>
<li class="listitem">
<pre class="literallayout"><a name="idm45822164755392-bb"></a><span class="identifier">extents</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">initializer_list</span><span class="special">&lt;</span> <span class="identifier">size_t</span> <span class="special">&gt;</span> values<span class="special">)</span><span class="special">;</span></pre>Creates an extents object with <code class="computeroutput">values</code>. </li>
</ol></div>
</div>
<div class="refsect2">
<a name="idm46604969230016"></a><h3>
<a name="idm45822164786496-bb"></a><code class="computeroutput">extents</code> public member functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><span class="identifier">size_type</span> <a name="idm45822164785936-bb"></a><span class="identifier">size</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>Returns the size (i.e. dimensionality) of the extents array. </li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">size_type</span> <a name="idm45822164784480-bb"></a><span class="identifier">linear</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p>Returns the linear size of the extents. This is equivalent to the product of each extent in each dimension. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">size_t</span> <span class="special">*</span> <a name="idm45822164782848-bb"></a><span class="identifier">data</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>
<p>Returns a pointer to the extents data array.</p>
<p>This is useful for passing the extents data to OpenCL APIs which expect an array of <code class="computeroutput">size_t</code>. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">const</span> <span class="identifier">size_t</span> <span class="special">*</span> <a name="idm45822164780752-bb"></a><span class="identifier">data</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>
</li>
<li class="listitem"><pre class="literallayout"><span class="identifier">iterator</span> <a name="idm45822164779088-bb"></a><span class="identifier">begin</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><span class="identifier">const_iterator</span> <a name="idm45822164778240-bb"></a><span class="identifier">begin</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><span class="identifier">const_iterator</span> <a name="idm45822164777120-bb"></a><span class="identifier">cbegin</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><span class="identifier">iterator</span> <a name="idm45822164776000-bb"></a><span class="identifier">end</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><span class="identifier">const_iterator</span> <a name="idm45822164775152-bb"></a><span class="identifier">end</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><span class="identifier">const_iterator</span> <a name="idm45822164774032-bb"></a><span class="identifier">cend</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre></li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">size_t</span> <span class="special">&amp;</span> <a name="idm45822164772912-bb"></a><span class="keyword">operator</span><span class="special">[</span><span class="special">]</span><span class="special">(</span><span class="identifier">size_t</span> index<span class="special">)</span><span class="special">;</span></pre>Returns a reference to the extent at <code class="computeroutput">index</code>. </li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">const</span> <span class="identifier">size_t</span> <span class="special">&amp;</span> <a name="idm45822164770624-bb"></a><span class="keyword">operator</span><span class="special">[</span><span class="special">]</span><span class="special">(</span><span class="identifier">size_t</span> index<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">bool</span> <a name="idm45822164768272-bb"></a><span class="keyword">operator</span><span class="special">==</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="extents.html" title="Class template extents">extents</a> <span class="special">&amp;</span> other<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>Returns <code class="computeroutput">true</code> if the extents in <code class="computeroutput">*this</code> are the same as <code class="computeroutput">other</code>. </li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">bool</span> <a name="idm45822164764384-bb"></a><span class="keyword">operator</span><span class="special">!=</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="extents.html" title="Class template extents">extents</a> <span class="special">&amp;</span> other<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>Returns <code class="computeroutput">true</code> if the extents in <code class="computeroutput">*this</code> are not the same as <code class="computeroutput">other</code>. </li>
</ol></div>
</div>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2013, 2014 Kyle Lutz<p>
        Distributed under the Boost Software License, Version 1.0. (See accompanying
        file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
      </p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="dim.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_compute/reference.html#header.boost.compute.utility.extents_hpp"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="invoke.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
